package cn.ecasoft.pojo.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.io.Serializable;


/**
 * @Author: LiangChun
 * @Description: 采集表记录
 * @DateTime: 2022/10/25
 **/
@Data

public class MeterOriginDTO implements Serializable {
    //采集表数据唯一ID
    @NotNull(message ="数据唯一标识UUID")
    private String ROW_GUID;
    @NotNull(message ="行政区划代码")
    private String M_Area_Number;
    @NotNull(message ="竣工年份")
    private String M_Year;
    @NotNull(message = "项目流水号")
    private String M_Project_Serial;
    @NotNull(message = "项目编码")
    private String M_Project_Code;
    @NotNull(message = "栋数（项目）")
    private String M_Buildings_NUMBER;
    @NotNull(message = "楼宇代码")
    private String M_Building_Code;
    @NotNull(message = "采集器数量")
    private String M_Collectors_Number;
    @NotNull(message = "项目流水号")
    private String M_Collector_Flowing;
    @NotNull(message = "建筑类型代码")
    private String M_Building_Type;
    @NotNull(message = "采集表流水号")
    private String M_Acquisition_Table;
    @NotNull(message = "采集表编码")
    private String M_Acquisition_Code;
    @NotNull(message = "能源类型代码")
    private String M_Energy_Type_Code;
    @NotNull(message = "分项能耗代码")
    private String M_Consumption_Code;
    @NotNull(message = "一级能耗节点代码")
    private String M_Primary_Code;
    @NotNull(message = "二级能耗节点代码")
    private String M_Secondary_Code;
    @NotNull(message = "用能代码")
    private String M_Energy_Code;
    @NotNull(message = "楼宇用能编码")
    private String M_Building_Energy_Code;
    @NotNull(message = "起始日期")
    private String M_Start_Data;
    @NotNull(message = "终止日期")
    private String M_End_Data;
    @JSONField(name="publicCons",unwrapped = true)
    private @Valid PublicConsDto publicConsDto;
    @JSONField(name="livingCons",unwrapped = true)
    private @Valid LivingConsDto livingConsDto;
}

@Data
class LivingConsDto {
    /*
     居住建筑 户内
     */
    @JSONField(name = "indoor",unwrapped = true)
    @NotNull(message = "居住建筑户内能耗")
    private @Valid LinvingIndoorCons linvingIndoorCons;
    /*
    居住建筑 户外
     */
    @JSONField(name = "public",unwrapped = true)
    @NotNull(message = "居住建筑公共能耗")
    private @Valid LivingPublicCons livingPublicCons;
    /*
    可再生能源总发电量
     */
    @NotNull(message = "居住建筑可再生能源总发电量")
    @JSONField(serialzeFeatures = SerializerFeature.WriteNullStringAsEmpty)
    private String M_Total_Power;
}

@Data
class LivingPublicCons{
    @NotNull(message = "居住建筑公共区域(电) ")
    private String M_Public_Electricity;
    @NotNull(message = "居住建筑公共区域（燃气）")
    private String M_Public_Gas;
    @NotNull(message = "居住建筑公共区域(其他)")
    private String M_Public_Other;
    @NotNull(message = "居住建筑可再生能源提供生活用热水供热量-公共")
    private String M_Hot_Water_Public;
    @NotNull(message = "居住建筑可再生能源发电-公共")
    private String M_Renewable_Public;
    @NotNull(message = "居住建筑可再生能源提供的空调用冷量-公共")
    private String M_Air_Cooling_public;
    @NotNull(message = "居住建筑可再生能源提供的空调用热量-公共")
    private String M_Air_Heat_Public;
}

@Data
class LinvingIndoorCons{
    @NotNull(message = "居住建筑户内(电)")
    private String M_Indoor_Electricity;
    @NotNull(message = "居住建筑户内(燃气)")
    private String M_Indoor_Gas;
    @NotNull(message = "居住建筑户内（其他）")
    private String M_Indoor_Other;
    @NotNull(message = "居住建筑可再生能源提供生活用热水供热量（户内）")
    private String M_Capacity_Indoor;
    @NotNull(message = "居住建筑可再生能源发电-户内")
    private String M_Renewable_Indoor;
    @NotNull(message = "居住建筑可再生能源提供的空调用冷量-户内")
    private String M_Air_Cooling_Indoor;
    @NotNull(message = "居住建筑可再生能源提供的空调用热量-户内")
    private String M_Air_Heat_Indoor;
}

/*
公共建筑 能耗
 */
@Data
class PublicConsDto {
    /*
    公共建筑-耗电
     */
    @JSONField(name = "elec",unwrapped = true)
    @NotNull(message = "公共建筑-耗电")
    private @Valid PublicElectric electric;
    /*
    公共建筑-特殊用电
     */
    @JSONField(name = "specialElec",unwrapped = true)
    @NotNull(message = "公共建筑-特殊用电")
    private @Valid PublicSpecialElectric publicSpecialElectric;
    /*
    公共建筑-燃气
     */
    @JSONField(name = "gas",unwrapped = true)
    @NotNull(message = "公共建筑-燃气")
    private @Valid PublicGas publicGas;
    /*
    公共建筑-其它
     */
    @JSONField(name = "other",unwrapped = true)
    @NotNull(message = "公共建筑-其它")
    private @Valid PublicOther other;
    /*
    公共建筑-可再生能源
     */
    @JSONField(name = "renewable",unwrapped = true)
    private PublicRenewable publicRenewable;
}

/*
公共建筑耗电(不包含特殊用电)
 */
@Data
class PublicElectric{
    /*
     总耗电
     */
    @NotNull(message = "公共建筑-耗电-总耗电")
    private String M_G_Electric;
    /*
     照明插座用电
     */
    @NotNull(message = "公共建筑-耗电-照明插座用电")
    private String M_Lighting;
    private String M_Indoor_Non_Public;
    private String M_Public_Lighting;
    private String M_Outdoor_Landscape;
    private String M_Indoor_Lighting;
    private String M_Indoor_Socket;
    /*
    暖通空调用电
     */
    @NotNull(message = "公共建筑-耗电-暖通空调用电")
    private String M_HVAC_Power;
    private String M_Cooling_Heating;
    private String M_Cold_Heat_Unit;
    private String M_Refrigeration_Pump;
    private String M_Cooling_Pump;
    private String M_Cooling_Tower;
    private String M_Air_End;
    private String M_Fresh_Air;
    private String M_Fan_Coil;
    private String M_Distributed_Air;
    /*
    动力设备用电
     */
    @NotNull(message = "公共建筑-耗电-动力设备用电")
    private String M_Power_Equipment;
    private String M_Elevator_Power;
    private String M_Supply_Water;
    private String M_Ventilation;
    private String M_Domestic_Water;
}

@Data
class PublicSpecialElectric{
    @NotNull(message = "公共建筑-特殊用电-总特殊用电")
    private String M_Special_Electricity;
    private String M_Information_Center;
    private String M_Laundry;
    private String M_Kitchen;
    private String M_Swimming_Pool;
    private String M_Entertainment;
    private String M_Boiling_Water;
    private String M_Charging_Pile;
    private String M_Other_Power;
    private String M_External_Power;
    private String M_Information_Equipment;
    private String M_Special_Air;
    private String M_Laundry_Equipment;
    private String M_Laundry_Air;
    private String M_Kitchen_Equipment;
    private String M_Kitchen_Air;
    private String M_Swimming_Equipment;
    private String M_Swimming_Air;
    private String M_Fitness_Equipment;
    private String M_Fitness_Air;
}

@Data
class PublicGas{
    @NotNull(message = "公共建筑-燃气-总燃气")
    private String M_Gas;
    private String M_Heating_Air;
    private String M_Hot_Water_Gas;
    private String M_Cooking_Gas;
}

@Data
class PublicOther{
    @NotNull(message = "公共建筑-其它-总其它")
    private String M_Other;
    private String M_QT_Heating;
    private String M_QT_Hot_Water;
    private String M_QT_Cooking;
}

@Data
class PublicRenewable{
    private String M_Heating_Capacity;
    private String M_Renewable;
    private String M_Air_Cooling;
    private String M_Air_Heat;
}